<template>
  <div>
    <!-- 日期区间 -->
    <div>{{ timeTypeName }}</div>
    <template v-if="+timeType === 1">
      <el-row
        :gutter="20"
        v-for="(item, index) in timeData.timeArray"
        :key="index"
      >
        <el-col :span="8">
          <div>{{ item.startDate }} 至 {{ item.endDate }}</div>
        </el-col>
        <el-col :span="8">
          <div>{{ item.startTime }} - {{ item.endTime }}</div>
        </el-col>
      </el-row>
    </template>
    <!-- 指定周期 -->
    <template v-if="+timeType === 2">
      <div>{{ timeData.weekName }}</div>
      <el-row
        :gutter="20"
        v-for="(item, index) in timeData.timeArray"
        :key="index"
      >
        <el-col :span="8">
          <div>{{ item.startTime }} - {{ item.endTime }}</div>
        </el-col>
      </el-row>
    </template>
    <!-- 指定日期 -->
    <template v-if="+timeType === 3">
      <el-row
        :gutter="20"
        v-for="(item, index) in timeData.timeArray"
        :key="index"
      >
        <el-col :span="6">
          <div>{{ item.date }}</div>
        </el-col>
        <el-col :span="6">
          <div>{{ item.startTime }} - {{ item.endTime }}</div>
        </el-col>
      </el-row>
    </template>
    <!-- 指定节假日 -->
    <template v-if="+timeType === 4">
      <el-row
        :gutter="20"
        v-for="(item, index) in timeData.timeArray"
        :key="index"
      >
        <el-col :span="3">
          <div>{{ item.year }} 年</div>
        </el-col>
        <el-col :span="6">
          <div>{{ item.holidayName }}</div>
        </el-col>
        <el-col :span="6">
          <div>{{ item.startTime }} - {{ item.endTime }}</div>
        </el-col>
      </el-row>
    </template>
  </div>
</template>

<script>
import tableMixin from '@/mixins/zmTableMixin'
export default {
  name: 'HolidayDetail',
  components: {},
  mixins: [tableMixin],
  props: {
    timeData: {
      type: Object,
      default () {
        return {}
      }
    },
    timeType: {
      type: [String, Number],
      default: ''
    }
  },
  data () {
    return {}
  },
  computed: {
    timeTypeName () {
      const arr = [0, '日期区间', '指定周期', '指定日期', '指定节假日']
      return arr[+this.timeType]
    }
  },
  watch: {},
  created () {},
  methods: {}
}
</script>

<style scoped lang='scss'>
</style>
